#!/bin/sh

ROOT=/autostop
DAEMON=$ROOT/bin/autoserver

export PATH=/autostop/bin:$PATH
export LD_LIBRARY_PATH=/autostop/lib:/autostop/qt/lib:$LD_LIBRARY_PATH


case "$1" in
        start)
		echo "Starting autoserver"
                start-stop-daemon -b -S -x $DAEMON
        ;;
	stop)
		echo "Stopping autoserver"
		start-stop-daemon -K -x $DAEMON
	;;
        *)
                echo "usage: autoserver {start|stop}"
esac

